#!/usr/bin/python3
# coding: utf-8
import sys
import re

lines = sys.stdin.readlines()

l0 = []
l1 = []


lemma = sys.argv[1]


for line in lines:
  num = line.split(':')[0]

  def match(l, *keywords):
    for k in keywords:
      res = not re.search(k, line) is None
      if res: break
    if res: l.append(num)
    return res


  if "one_count_foreach_login" in lemma:
    (
    match(l0, "KU\( senc\(.*") or
    match(l1, "")

    )


print(l0, l1)
ranked = l0 + l1 
for i in ranked:
  print(i)
